//:C03:Copare.cpp
// Demonstrates compare() and swap()
#include <cassert>
#include <string>
using namespace std;

int main(void) {
  string first("This");
  string second("That");
  assert(first.compare(first) == 0);
  assert(second.compare(second) == 0);

  // Which is lexically greater?
  assert(first.compare(second) > 0);
  assert(second.compare(first) < 0);
  first.swap(second);  
  assert(second.compare(first) > 0);
}